mod command_interaction;

use std::process::Command;

use wasm_bindgen::prelude::*; // 用于加载 Prelude（预导入）模块

#[wasm_bindgen]
pub fn fib(n: u32) -> u32 {
    if n == 0 || n == 1 {
        return 1;
    }
    fib(n - 1) + fib(n - 2)
}

#[wasm_bindgen]
pub fn open_calc() {
    let result = Command::new("calc.exe").spawn();

    match result {
        Err(e) => {
            eprintln!("Error occurred: {}", e);
        },
        Ok(_) => {
            println!("Calculator opened successfully.");
        }
    }
}

